<?php
/**
 * @package examples
 */
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();

header('Content-Type:text/html; charset=UTF-8');
$location = 'http://127.0.0.1/ZFBook/html/webservice/soap/';
$rooms    = array();
$client   = new Zend_Soap_Client(null, array('location' => $location, 'uri' => 'http://reservation'));
?>


<h3>Salles disponibles</h3>
<ul>
<?php foreach ($client->getRooms() as $room) : ?>
  <li><?php echo $rooms[$room['id']] = $room['name'] . ' (' . $room['capacity'] . ' places)'; ?></li>
<?php endforeach; ?>
</ul>
<h3>Réservations enregistrées :</h3>
<?php $reservations = $client->getReservations('2008-07-01 00:00:00', '2009-07-01 00:00:00'); ?>
<ul>
<?php foreach ($reservations as $reservation) : ?>
  <li>
    <?php echo $rooms[$reservation['id_room']]; ?>, de 
    <?php echo $reservation['date_begin']; ?> à 
    <?php echo $reservation['date_end']; ?> : 
    <?php echo $reservation['usage']; ?>
  </li>
<?php endforeach; ?>
</ul>

